<extend name="Public/Dialog/Common"/>
<block name="pageContent">
<div class="bjui-pageContent">
    <form action="__ACTION__" class="pageForm" data-toggle="validate" method="post">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
            <tr>
                <td>
                    <label class="control-label x85">新郎：</label>
                    <input type="text" name="bridegroom" value="{$arr.bridegroom}" size="20">
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">新郎电话：</label>
                    <input type="text" name="bridegroom_tel" value="{$arr.bridegroom_tel}" size="20">
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">新娘：</label>
                    <input type="text" name="bride" value="{$arr.bride}" size="20">
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">新娘电话：</label>
                    <input type="text" name="bride_tel" value="{$arr.bride_tel}" size="20">
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">婚礼时间：</label>
                    <input type="text" name="marry_time" value="{$arr.marry_time}" data-toggle="datepicker" data-pattern="yyyy-MM-dd hh:mm:s" size="20">
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">酒店：</label>
                    <textarea type="text" name="marry_grogshop" size="50">{$arr.marry_grogshop}</textarea>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">婚礼地址：</label>
                    <textarea type="text" name="marry_address" size="50">{$arr.marry_address}</textarea>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">请帖音频：</label>
                    <div style="display: inline-block; vertical-align: middle;">
                        <!-- 上传控件 -->
                        <input type="file" id="upload_marry_voice">
                        <!-- 隐藏域, 保存上传文件的路径 -->
                        <input type="hidden" name="marry_voice" value="{$arr.marry_voice}">
                        <!-- 提示内容 -->
                        <div class="upload-img-box" style="display: inline-block; vertical-align: middle;">
                            <div class="upload-pre-file"><span class="upload_icon_all"></span>{$arr.marry_voice}</div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">请帖视频：</label>
                    <div style="display: inline-block; vertical-align: middle;">
                        <!-- 上传控件 -->
                        <input type="file" id="upload_marry_video">
                        <!-- 隐藏域, 保存上传文件的路径 -->
                        <input type="hidden" name="marry_video" value="{$arr.marry_video}">
                        <!-- 提示内容 -->
                        <div class="upload-img-box" style="display: inline-block; vertical-align: middle;">
                            <div class="upload-pre-file"><span class="upload_icon_all"></span>{$arr.marry_video}</div>
                        </div>
                    </div>

                    <!--<textarea type="text" name="marry_video" size="50">{$arr.marry_video}</textarea>-->
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</block>
<block name="pageJavascript">
    <script type="text/javascript">
        //上传音频
        $.CurrentNavtab.find("#upload_marry_voice").uploadify({
            "height"          : 30,
            "swf"             : "__BJUI/plugins/uploadify/scripts/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传附件",
            "uploader"        : "{:U('File/upload',array('session_id'=>session_id()))}",
            "width"           : 120,
            'removeTimeout'	  : 1,
            "onUploadSuccess" : function(file, data){
                var data = $.parseJSON(data);
                console.log(data);
                if(data.status){
                    var name = "marry_voice";
                    $.CurrentNavtab.find("input[name="+name+"]").val(data.data.path);
                    $.CurrentNavtab.find("input[name="+name+"]").parent().find('.upload-img-box').html(
                            "<div class=\"upload-pre-file\">" +
                            "<span class=\"upload_icon_all\"></span>" + data.info +
                            "</div>"
                    );
                } else {
                    $(this).alertmsg('error', data.info);
                }
            },
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        //上传视频
        $.CurrentNavtab.find("#upload_marry_video").uploadify({
            "height"          : 30,
            "swf"             : "__BJUI/plugins/uploadify/scripts/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传附件",
            "uploader"        : "{:U('File/upload',array('session_id'=>session_id()))}",
            "width"           : 120,
            'removeTimeout'	  : 1,
            "onUploadSuccess" : function(file, data){
                var data = $.parseJSON(data);
                console.log(data);
                if(data.status){
                    var name = "marry_video";
                    $.CurrentNavtab.find("input[name="+name+"]").val(data.data.path);
                    $.CurrentNavtab.find("input[name="+name+"]").parent().find('.upload-img-box').html(
                            "<div class=\"upload-pre-file\">" +
                            "<span class=\"upload_icon_all\"></span>" + data.info +
                            "</div>"
                    );
                } else {
                    $(this).alertmsg('error', data.info);
                }
            },
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
    </script>
</block>